<%= render 'base/cost/cost_summary' %>
<%= render 'base/notifications/notifications_summary' unless Settings.show_cost %>

<%= section_panel 'Counts', :width => 'single', :position => 'right' do %>
  <% user_count     = current_user.organization.users.size
     assembly_count = @assemblies.size %>
  <ul class="glance">
    <li>
      <%= link_to "#{edit_organization_path}#users" do %>
        <strong><%= user_count %></strong>
        <span><%= 'user'.pluralize(user_count) %></span>
      <% end %>
    </li>
    <li>
      <%= link_to clouds_path do %>
        <strong><%= @cloud_count %></strong>
        <span><%= 'cloud'.pluralize(@cloud_count) %></span>
      <% end %>
    </li>
    <li>
      <%= link_to assemblies_path do %>
        <strong><%= assembly_count %></strong>
        <span><%= 'assembly'.pluralize(assembly_count) %></span>
      <% end %>
    </li>
  </ul>
<% end %>

<% favs = current_user.favorites.where(:organization_id => current_user.organization_id).order(:ci_name) %>
<% if favs.blank? %>
  <%= section_panel 'Assemblies', :width => 'single', :position => 'right' do %>
    <%= ci_list @assemblies, :toolbar => {:sort_by => [%w(Name ciName)], :filter_by => %w(ciName)} do |builder, target| %>
      <% builder.target link_to('', assembly_path(target), :remote => false) %>
      <% builder.icon :none %>
      <% builder.top do %>
        <span class="topname"><%= target.ciName %></span>
      <% end %>
      <% builder.middle do %>
        <%= link_to(icon(site_icon('design'), 'design'),         assembly_design_path(target)) %>&nbsp;&nbsp;
        <%= link_to(icon(site_icon('transition'), 'transition'), assembly_transition_path(target)) %>&nbsp;&nbsp;
        <%= link_to(icon(site_icon('operations'), 'operations'), assembly_operations_path(target)) %>&nbsp;&nbsp;
      <% end %>
      <% builder.bottom :none %>
    <% end %>
  <% end %>
<% else %>
  <%= render 'favorite_list', :favorites => favs %>
<% end %>

<%= render 'base/notifications/notifications_summary' if Settings.show_cost %>
